import {createRouter, createWebHistory} from 'vue-router';
import Machine from '../views/machine/Machine.vue';
import Plugin from '../views/plugin/Plugin.vue';
import PluginLabel from '../views/plugin-label/PluginLabel.vue';
import VmMachineManage from '../views/machine/relation/VmMachineManage.vue';
import OperateLog from '../views/operate/log.vue';
import {ref} from "vue";
import currentPath from "@/components/currentPath.vue";
import Demo from '@/views/demo/Demo.vue'

const baseUrl = ref(null);
baseUrl.value = import.meta.env.BASE_URL;

const routes = [
    {path: baseUrl.value, component: Machine},
    {path: baseUrl.value + '/resident-machine', component: Machine},
    {path: baseUrl.value + '/resident-plugin', component: Plugin},
    {path: baseUrl.value + '/plugins-setting', component: PluginLabel},
    {path: baseUrl.value + '/operate-log', component: OperateLog},
    {path: baseUrl.value + '/currentPath', component: currentPath},
    {path: baseUrl.value + '/machine-manage/:id', component: VmMachineManage},
    {
        path: baseUrl.value + '/demo',
        name: 'Demo',
        component: Demo,
        meta: {
            title: 'Demo页面'
        }
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;